//package pers.zc.activiti.controller;
//
//import org.activiti.engine.RepositoryService;
//import org.activiti.engine.RuntimeService;
//import org.activiti.engine.TaskService;
//import org.activiti.engine.repository.Deployment;
//import org.activiti.engine.repository.ProcessDefinition;
//import org.activiti.engine.runtime.ProcessInstance;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import pers.zc.activiti.service.TestService;
//
///**
// * @Annotion:  服务流程创建
// * @ClassName: ServiceTaskController
// * @Author: Lin Fuyuan
// * @Date: 2019/9/21  20:37
// * @Version: 1.0
// */
//@Controller
//@RequestMapping("/task")
//public class ServiceTaskController {
//    /**
//     * 流程仓库Service ,用于管理流程仓库,例如 部署,删除,读取流程资源
//     */
//    @Autowired
//    private RepositoryService repositoryService;
//    /**
//     * 运行时service,可以处理所有正在运行状态的流程实例,任务等
//     */
//    @Autowired
//    private RuntimeService runtimeService;
//    /**
//     * 任务service,用户管理.查询任务,例如 签收 办理 指派 等
//     */
//    @Autowired
//    private TaskService taskService;
//    /**
//     * 自定义业务处理
//     */
//    @Autowired
//    private TestService testService;
//    @GetMapping("/test")
//    public void task(){
//        /*部署流程*/
//        Deployment deploy = repositoryService.createDeployment().addClasspathResource("ServiceTask.bpmn").name("testName").deploy();
//        System.out.println("流程id" + deploy.getId());
//    }
//
//    @RequestMapping("/run")
//    public void run1(){
//        /*查询流程定义*/
//        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId("2501").singleResult();
//        /*跑起*/
//        System.out.println("流程定义id"+processDefinition.getId());
//        /*获取实例*/
//        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinition.getKey());
//        System.out.println("流程实例id"+processInstance.getId());
//    }
//}
